/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "t_version_channels")
//@NamedQueries({@NamedQuery(name = "TVersionChannels.findAll", query = "SELECT t FROM TVersionChannels t"), @NamedQuery(name = "TVersionChannels.findByChannelversionid", query = "SELECT t FROM TVersionChannels t WHERE t.tVersionChannelsPK.channelversionid = :channelversionid"), @NamedQuery(name = "TVersionChannels.findByChannelId", query = "SELECT t FROM TVersionChannels t WHERE t.tVersionChannelsPK.channelId = :channelId"), @NamedQuery(name = "TVersionChannels.findByChannelName", query = "SELECT t FROM TVersionChannels t WHERE t.channelName = :channelName"), @NamedQuery(name = "TVersionChannels.findByFunctionName", query = "SELECT t FROM TVersionChannels t WHERE t.functionName = :functionName"), @NamedQuery(name = "TVersionChannels.findByOrdered", query = "SELECT t FROM TVersionChannels t WHERE t.ordered = :ordered"), @NamedQuery(name = "TVersionChannels.findByCreatedDate", query = "SELECT t FROM TVersionChannels t WHERE t.createdDate = :createdDate"), @NamedQuery(name = "TVersionChannels.findByPreviousId", query = "SELECT t FROM TVersionChannels t WHERE t.previousId = :previousId"), @NamedQuery(name = "TVersionChannels.findByPrimalId", query = "SELECT t FROM TVersionChannels t WHERE t.primalId = :primalId"), @NamedQuery(name = "TVersionChannels.findByLevel", query = "SELECT t FROM TVersionChannels t WHERE t.level = :level")})
public class TVersionChannels implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TVersionChannelsPK tVersionChannelsPK;
    @Column(name = "channel_name")
    private String channelName;
    @Column(name = "function_name")
    private String functionName;
    @Column(name = "ordered")
    private Integer ordered;
    @Column(name = "created_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdDate;
    @Column(name = "previous_id")
    private String previousId;
    @Column(name = "primal_id")
    private String primalId;
    @Column(name = "level")
    private String level;

    public TVersionChannels() {
    }

    public TVersionChannels(TVersionChannelsPK tVersionChannelsPK) {
        this.tVersionChannelsPK = tVersionChannelsPK;
    }

    public TVersionChannels(String channelversionid, String channelId) {
        this.tVersionChannelsPK = new TVersionChannelsPK(channelversionid, channelId);
    }

    public TVersionChannelsPK getTVersionChannelsPK() {
        return tVersionChannelsPK;
    }

    public void setTVersionChannelsPK(TVersionChannelsPK tVersionChannelsPK) {
        this.tVersionChannelsPK = tVersionChannelsPK;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getFunctionName() {
        return functionName;
    }

    public void setFunctionName(String functionName) {
        this.functionName = functionName;
    }

    public Integer getOrdered() {
        return ordered;
    }

    public void setOrdered(Integer ordered) {
        this.ordered = ordered;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public String getPreviousId() {
        return previousId;
    }

    public void setPreviousId(String previousId) {
        this.previousId = previousId;
    }

    public String getPrimalId() {
        return primalId;
    }

    public void setPrimalId(String primalId) {
        this.primalId = primalId;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tVersionChannelsPK != null ? tVersionChannelsPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TVersionChannels)) {
            return false;
        }
        TVersionChannels other = (TVersionChannels) object;
        if ((this.tVersionChannelsPK == null && other.tVersionChannelsPK != null) || (this.tVersionChannelsPK != null && !this.tVersionChannelsPK.equals(other.tVersionChannelsPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.TVersionChannels[tVersionChannelsPK=" + tVersionChannelsPK + "]";
    }

}
